
import React, { Component } from 'react'


export default class Detail extends Component {

  constructor(props){
    super(props);
    if(!this.props.location.state){
      console.log("跳转到列表页面");
      this.props.history.push("/Query");
    }

  }

  render() {

    return (
      <div>
        <h1>新闻详情</h1>
        <div>{this.props.location.state && this.props.location.state.newsid}</div>
      </div>
    )
  }
}
